import request from '@/utils/request'
import ServerNameEnum from '@/api/ServerNameEnum'

// 视频
export const camerainfo = (params) => {
  return request({
    url: `${ServerNameEnum.SCREEN_SERVICE}/camerainfo/page`,
    method: 'GET',
    params
  })
}
/*视频快照*/
export const cameraImage = (code) => {
  return request({
    url: `${ServerNameEnum.SCREEN_SERVICE}/hikVideo/getPicUrl/${code}`,
    method: 'GET',
  })
}
// 云台视频移动
export function controlling(data) {
  return request({
    url: `${ServerNameEnum.SCREEN_SERVICE}/hikVideo/controlling`,
    method: "POST",
    data
  })
}
/*矿山综合监管——矿企*/
export const getEnterprise = (params) => {
  return request({
    url: `${ServerNameEnum.SAFTY_SERVICE}/safty/enterprise/list`,
    method: 'GET',
    params
  })
}

/*御道*/
// export function getYuDao() {
//   return request({
//     url: `${ServerNameEnum.SAFTY_SERVICE}/safty/form/list`,
//     method: "GET",
//   })
// }
export function getYuDao() {
  return request({
    url: `/hikvision/yudaoconfig/list`,
    method: "GET",
  })
}
/*资质证照*/
export function getCertifcate() {
  return request({
    url: `${ServerNameEnum.SAFTY_SERVICE}/safty/certifcate/list`,
    method: "GET",
  })
}

/*资质证照分页*/
export function getCertifcatePageList(params) {
  return request({
    url: `${ServerNameEnum.SAFTY_SERVICE}/safty/certifcate/pageList`,
    method: "GET",
    params
  })
}

/*巡检任务*/
export function tinspectiontask(params) {
  return request({
    url: `/xunjian/tinspectiontask/page`,
    method: "GET",
    params
  })
}

/*巡检任务 新增*/
export function tinspectiontaskAdd(data) {
  return request({
    url: `/xunjian/tinspectiontask`,
    method: "POST",
    data
  })
}
/*巡检任务 获取巡检人*/
export function tinspecGetRouteList(params) {
  return request({
    url: `/xunjian/tinspectionroute/getRouteList`,
    method: "GET",
    params
  })
}
/*报警记录 分页*/
export function eventworkorderPage(data) {
  return request({
    url: `/hikvision/eventworkorder/page`,
    method: "POST",
    data
  })
}
/*报警记录 正报误报*/
export function eventworkorderBao(data) {
  return request({
    url: `/hikvision/eventworkorder`,
    method: "POST",
    data
  })
}
/*报警记录 分页 搜索条件 等级*/
export function warninglevelPage(data) {
  return request({
    url: `/hikvision/warninglevel/page`,
    method: "POST",
    data
  })
}
/*报警记录 分页 搜索条件 事件类型*/
export function eventconfigurePage(data) {
  return request({
    url: `/hikvision/eventconfigure/page`,
    method: "POST",
    data
  })
}

/*矿山档案*/
// export function mineList(params) {
//   return request({
//     url: `${ServerNameEnum.SAFTY_SERVICE}/safty/mine/list`,
//     method: "GET",
//     params
//   })
// }
export function mineList() {
  return request({
    url: `${ServerNameEnum.SAFTY_SERVICE}/safty/mine/ksList`,
    method: "GET",
   })
}
export const statisticsList1 = () => {
  return request({
    url: `${ServerNameEnum.SCREEN_SERVICE}/eventrecord/timeCount`,
    method: 'GET',
  })
}
export const statisticsList2 = () => {
  return request({
    url: `${ServerNameEnum.SCREEN_SERVICE}/eventrecord/getDateList`,
    method: 'GET',
  })
}
export const statisticsList3 = () => {
  return request({
    url: `${ServerNameEnum.SCREEN_SERVICE}/eventworkorder/getDateList`,
    method: 'GET',
  })
}



/*矿山一张图  巡检隐患统计*/
export function thidManageSta(params) {
  return request({
    url: `/xunjian/thiddendangermanage/statistics`,
    method: "GET",
    params
  })
}

/*矿山一张图  巡检人员信息*/
export function saftyEmpCount(params) {
  return request({
    url: `/safty/safty/emp/count`,
    method: "GET",
    params
  })
}


/*矿山一张图  巡检人员信息分页*/
export function saftyEmpPagecount(params) {
  return request({
    url: `/safty/safty/emp/pageCount`,
    method: "GET",
    params
  })
}

/*矿山一张图  隐患类型占比*/
export function thidManagePercentage(params) {
  return request({
    url: `/xunjian/thiddendangermanage/hiddenDangerPercentage`,
    method: "GET",
    params
  })
}
/*矿山一张图  峪道预警分析*/
export function timeYudaoCount(params) {
  return request({
    url: `${ServerNameEnum.SCREEN_SERVICE}/eventrecord/timeYudaoCount`,
    method: "GET",
    params
  })
}
/*矿山一张图  报警趋势分析*/
export function yudaoconfigMonthlist(params) {
  return request({
    url: `${ServerNameEnum.SCREEN_SERVICE}/yudaoconfig/monthlist`,
    method: "GET",
    params
  })
}

/*矿山一张图  检查站*/
export function checkpointJczList(params) {
  return request({
    url: `/safty/safty/checkpoint/jczList`,
    method: "GET",
    params
  })
}


/*矿山综合监管 车辆进出*/
export function staCurrentDayList(params) {
  return request({
    url: `/safty/safty/statistics/currentDayList`,
    method: "GET",
    params
  })
}
/*矿山综合监管 车辆进出分页*/
export function staCurrentDayPageList(params) {
  return request({
    url: `/safty/safty/statistics/currentDayPageList`,
    method: "GET",
    params
  })
}


/*矿山综合监管  设备运行状态*/
export function staEquipment(params) {
  return request({
    url: `/safty/safty/equipment/list`,
    method: "GET",
    params
  })
}

/*矿山综合监管  设备运行状态分页*/
export function staEquipmentPageList(params) {
  return request({
    url: `/safty/safty/equipment/pageList`,
    method: "GET",
    params
  })
}
/*矿山综合监管  矿山概览*/
export function staMineOverviewList(params) {
  return request({
    url: `/safty/safty/statistics/mineOverviewList`,
    method: "GET",
    params
  })
}

/*矿山综合监管  车辆进出记录*/
export function vehicleEntryAndExitList(params) {
  return request({
    url: `/safty/safty/statistics/vehicleEntryAndExitList`,
    method: "GET",
    params
  })
}

/*矿山综合监管  矿山开采量统计*/
export function pitheadMiningStatistics(params) {
  return request({
    url: `/safty/safty/pithead/miningStatistics`,
    method: "GET",
    params
  })
}

/*矿山一张图  综合统计*/
export function comprehensiveOverviewList(params) {
  return request({
    url: `/safty/safty/statistics/comprehensiveOverviewList`,
    method: "GET",
    params
  })
}


/*巡检地图  巡检点 人员点位信息*/
export function staffGetTrackByUserId(params) {
  return request({
    url: `/staff-track/getTrackByUserId`,
    method: "GET",
    params
  })
}


/*巡检地图  隐患排查 隐患事件 隐患整改结果*/
export function thiddenCheckList(params) {
  return request({
    url: `/xunjian/thiddendangermanage/check/list`,
    method: "GET",
    params
  })
}

/*巡检地图  隐患事件 隐患整改结果*/
export function thiddenCheckListpage(params) {
  return request({
    url: `/xunjian/thiddendangermanage/page`,
    method: "GET",
    params
  })
}


/*巡检地图  巡检统计*/
export function mineGetMangeCount(params) {
  return request({
    url: `/safty/safty/mine/getMangeCount`,
    method: "GET",
    params
  })
}
/*巡检地图  巡检统计*/
export function tinspectiontaskMonthList(params) {
  return request({
    url: `/xunjian/tinspectiontask/monthList`,
    method: "GET",
    params
  })
}
export function getEventCount(params) {
  return request({
    url: `/hikvision/eventrecord/getEventCount`,
    method: "GET",
    params
  })
}
export function videoTypeList() {
  return request({
    url: `/system/dict/data/list?pageNum=1&pageSize=99&dictType=camera_type&status=0`,
    method: "GET"
  })
}
export function getYudaoCameraInfoList(params) {
  return request({
    url: `/hikvision/camerainfo/getYudaoCameraInfoList`,
    method: "GET",
    params
  })
}
export function camerainfolist(data) {
  return request({
    url: `/hikvision/camerainfo/page/list`,
    method: "POST",
    data
  })
}
export function getManageCount() {
  return request({
    url: `/xunjian/thiddendangermanage/getManageCount`,
    method: "GET"
  })
}
export function yudaoconfigCount(params) {
  return request({
    url: `/hikvision/yudaoconfig/list/count`,
    method: "GET",
    params
  })
}

export function xunjianCountList(params) {
  return request({
    url: `/xunjian/tinspectiontask/xunjianCountList`,
    method: "GET",
    params
  })
}
export function getEnterprisesName() {
  return request({
    url: `/safty/safty/enterprise/getEnterprisesName`,
    method: "GET"
  })
}
export function getCameraMenuList() {
  return request({
    url: `/hikvision/cameramenu/getCameraMenuList`,
    method: "GET"
  })
}
export function saveMenu(data) {
  return request({
    url: `/hikvision/cameramenu/saveMenu`,
    method: "POST",
    data
  })
}
export function deleteInfo(params) {
  return request({
    url: `/hikvision/cameramenu/deleteInfo`,
    method: "GET",
    params
  })
}
export function updateMenu(data) {
  return request({
    url: `/hikvision/cameramenu/updateMenu`,
    method: "POST",
    data
  })
}
export function pageList(data) {
  return request({
    url: `/hikvision/cameramenu/page/list`,
    method: "POST",
    data
  })
}
export function getEventTypeCount(params) {
  return request({
    url: `/hikvision/eventrecord/getEventTypeCount`,
    method: "GET",
    params
  })
}
export function getCount(params) {
  return request({
    url: `/hikvision/vehicleevents/getCount`,
    method: "GET",
    params
  })
}
export function vehicleeventsList(data) {
  return request({
    url: `/hikvision/vehicleevents/page/list`,
    method: "POST",
    data
  })
}
export function patrol(data, method = "post") {
  return request({
    url: `/hikvision/patrol`,
    method: method,
    data,
  });
}
export function personCompleteData(params) {
  return request({
    url: `/hikvision/patrol/personCompleteData`,
    method: 'get',
    params
  });
}
export function patorlCount(params) {
  return request({
    url: `/hikvision/patrol/patorlCount`,
    method: 'get',
    params
  });
}
export function xunjianList(params) {
  return request({
    url: `/hikvision/patrol/userList`,
    method: 'get',
    params
  });
}
export function getCameraInfoCount(params) {
  return request({
    url: `/hikvision/camerainfo/getCameraInfoCount`,
    method: 'get',
    params
  });
}

export function getYudaoCameraCountList(params) {
  return request({
    url: `/hikvision/camerainfo/getYudaoCameraCountList`,
    method: 'get',
    params
  });
}

export function InspectionPointList(data) {
  return request({
    url: `/hikvision/pointConfig/page/list`,
    method: "POST",
    data,
  });
}

// 视频 /hikVideo/getHistory/videoUrl
export function getHistoryUrl(params) {
  return request({
    url: `/hikvision/hikVideo/getHistory/videoUrl`,
    method: "get",
    params
  })
}

export const getStreamUrl = (code) => {
  return request({
    url: `/hikvision/hikVideo/getStreamUrl/${code}`,
    method: 'GET',
  })
}

// 隐患点位
export function thidManagePercentageList() {
  return request({
    url: `/xunjian/thiddendangermanage/list`,
    method: "GET",
  })
}

// 新告警信息（车辆、人员）
export const monitoringAlarmList = (data)=>{
  return request({
    url: '/hikvision/vehicleevents/monitoringAlarmList',
    method: 'post',
    data
  })
}
